using GraphProcessor;
using IQIGame.Onigao.Logic;
using UnityEngine;

namespace IQIGame.Onigao.GamePlay.Editors
{
	[System.Serializable, NodeMenuItem(LevelEditorConst.Execution + "/" + LevelEditorConst.LeaveLevel, typeof(LevelServiceGraph))]
    public partial class LevelServiceExecutionNode_LeaveLevel : LevelServiceExecutionNode
    {
		protected override ServiceExecutionType mServiceType => ServiceExecutionType.LeaveLevel;
        public override string name => LevelEditorConst.LeaveLevel;
		
# region property
        [LevelServiceEditorCustomProperty(ServiceExecutionType.LeaveLevel, "RegionInstance表ID")]
        public int outRegionCid;
        [LevelServiceEditorCustomProperty(ServiceExecutionType.LeaveLevel, "指定传送点ID")]
        public int outPortalMcid;
# endregion property
		protected override LevelServiceCustomConfig CreateConfig()
        {
        	LevelServiceExecutionCustom_LeaveLevel rConfig;
# region CreateConfig
            rConfig = new LevelServiceExecutionCustom_LeaveLevel
            {
                outRegionCid = this.outRegionCid,
                outPortalMcid = this.outPortalMcid,
            };
# endregion CreateConfig
            return rConfig;
        }

        protected override void OnSync(EditorLevelServiceExecutionConfig newConfig, LevelServiceExecutionNode tempNode)
        {
# region OnSync
            if (tempNode is LevelServiceExecutionNode_LeaveLevel rNode)
            {
                this.outRegionCid = rNode.outRegionCid;
                this.outPortalMcid = rNode.outPortalMcid;
            }
# endregion OnSync
        }
    }
}